From bc3d9ffadf5478f4d18ee5d1dd4fdb1131a0eedd Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 7 Jan 2004 22:02:02 +0000 Subject: [PATCH] Remove the redundant name and stock_id parameters, adjust all callers. Wed Jan 7 23:03:32 2004 Matthias Clasen * gtk/gtkactiongroup.h: * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): Remove the redundant name and stock_id parameters, adjust all callers. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-4 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ gtk/gtkactiongroup.c | 36 ++++++++++++++++-------------------- gtk/gtkactiongroup.h | 6 ++---- 7 files changed, 48 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba65c03fdf..f8aaf32c98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Jan 7 23:03:32 2004 Matthias Clasen + + * gtk/gtkactiongroup.h: + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Remove the redundant name and stock_id parameters, adjust all callers. + Wed Jan 7 22:20:20 2004 Matthias Clasen * gtk/gtkaction.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ba65c03fdf..f8aaf32c98 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Wed Jan 7 23:03:32 2004 Matthias Clasen + + * gtk/gtkactiongroup.h: + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Remove the redundant name and stock_id parameters, adjust all callers. + Wed Jan 7 22:20:20 2004 Matthias Clasen * gtk/gtkaction.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ba65c03fdf..f8aaf32c98 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Wed Jan 7 23:03:32 2004 Matthias Clasen + + * gtk/gtkactiongroup.h: + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Remove the redundant name and stock_id parameters, adjust all callers. + Wed Jan 7 22:20:20 2004 Matthias Clasen * gtk/gtkaction.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ba65c03fdf..f8aaf32c98 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Wed Jan 7 23:03:32 2004 Matthias Clasen + + * gtk/gtkactiongroup.h: + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Remove the redundant name and stock_id parameters, adjust all callers. + Wed Jan 7 22:20:20 2004 Matthias Clasen * gtk/gtkaction.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ba65c03fdf..f8aaf32c98 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Wed Jan 7 23:03:32 2004 Matthias Clasen + + * gtk/gtkactiongroup.h: + * gtk/gtkactiongroup.c (gtk_action_group_add_action_with_accel): + Remove the redundant name and stock_id parameters, adjust all callers. + Wed Jan 7 22:20:20 2004 Matthias Clasen * gtk/gtkaction.h: diff --git a/gtk/gtkactiongroup.c b/gtk/gtkactiongroup.c index 6389db80f3..348ce45514 100644 --- a/gtk/gtkactiongroup.c +++ b/gtk/gtkactiongroup.c @@ -295,17 +295,16 @@ gtk_action_group_add_action (GtkActionGroup *action_group, /** * gtk_action_group_add_action_with_accel: - * @action_group: the action group (#GtkActionGroup) - * @action: the action to add (#GtkAction) - * @name: the name of the action to add + * @action_group: the action group + * @action: the action to add * @accelerator: the accelerator for the action, in - * the format understood by gtk_accelerator_parse(). - * @stock_id: the stock icon to display + * the format understood by gtk_accelerator_parse(), or %NULL to use the + * stock accelerator * * Adds an action object to the action group and sets up the accelerator. * - * If @accelerator is %NULL, attempt to use the accelerator associated with - * @stock_id. + * If @accelerator is %NULL, attempts to use the accelerator associated + * with the stock_id of the action. * * Accel paths are set to * <Actions>/group-name/action-name. @@ -315,14 +314,16 @@ gtk_action_group_add_action (GtkActionGroup *action_group, void gtk_action_group_add_action_with_accel (GtkActionGroup *action_group, GtkAction *action, - const char *name, - const char *accelerator, - const char *stock_id) + const gchar *accelerator) { gchar *accel_path; guint accel_key = 0; GdkModifierType accel_mods; GtkStockItem stock_item; + const gchar *name; + const gchar *stock_id; + + g_object_get (action, "name", &name, "stock_id", &stock_id, NULL); accel_path = g_strconcat ("/", action_group->private_data->name, "/", name, NULL); @@ -487,10 +488,9 @@ gtk_action_group_add_actions_full (GtkActionGroup *action_group, entries[i].callback, user_data, (GClosureNotify)destroy, 0); - gtk_action_group_add_action_with_accel (action_group, action, - entries[i].name, - entries[i].accelerator, - entries[i].stock_id); + gtk_action_group_add_action_with_accel (action_group, + action, + entries[i].accelerator); g_object_unref (action); } } @@ -586,9 +586,7 @@ gtk_action_group_add_toggle_actions_full (GtkActionGroup *action_group, gtk_action_group_add_action_with_accel (action_group, action, - entries[i].name, - entries[i].accelerator, - entries[i].stock_id); + entries[i].accelerator); g_object_unref (action); } } @@ -699,9 +697,7 @@ gtk_action_group_add_radio_actions_full (GtkActionGroup *action_group, gtk_action_group_add_action_with_accel (action_group, action, - entries[i].name, - entries[i].accelerator, - entries[i].stock_id); + entries[i].accelerator); g_object_unref (action); } diff --git a/gtk/gtkactiongroup.h b/gtk/gtkactiongroup.h index bd4ff94f69..c4ef39b55c 100644 --- a/gtk/gtkactiongroup.h +++ b/gtk/gtkactiongroup.h @@ -112,10 +112,8 @@ GList *gtk_action_group_list_actions (GtkActionGroup * void gtk_action_group_add_action (GtkActionGroup *action_group, GtkAction *action); void gtk_action_group_add_action_with_accel (GtkActionGroup *action_group, - GtkAction *action, - const char *name, - const char *accelerator, - const char *stock_id); + GtkAction *action, + const gchar *accelerator); void gtk_action_group_remove_action (GtkActionGroup *action_group, GtkAction *action); -- 2.30.2